const firstaid = {
    name:'Firstaid',
    template: `<div class="bodypd wh100 ovy ff1">
        <div class='swiper w100 h140 bgf1' id="swiper">
            <el-carousel 
                trigger="click" 
                height="138px"
                autoplay="false"
                >
                <a :href="a_href" class="wh100 disi bdn pr z3">
                    <img class="wh100 bdn" :src='info.img'><!--跳转-->
                </a>
            </el-carousel>
        </div>
        <div class="h30"></div>
        <div class="marb10">
            <div class="cont fs16 pdtb10 fsw9 sp3 " v-text="types1.name"></div>
            <div class="flex flw"><!--跳转-->
                <div v-for="(v,k) in types1.list" class="w050 ">
                    <a class="w120 h50 flex lrm__ bg pdlr10" :href="hrefA+'/dordinary?a=1&id='+v.id">
                        <img :src="v.avatar" class="w40 h40 tbm" >
                        <div class="cont2 pdl10 bbx fsw5 fs15 sp2 h20 tbm " v-text="v.name.substr(0,4)"></div>
                    </a>
                </div>
            </div>
        </div>
        <div v-for="(v,k) in types2">
            <div class="cont fs16 pdtb10 fsw9 sp3 " v-text="v.name"></div>
            <div class="flex  w100 flw bbx">
                <template v-for="(vv,kk) in v.list">
                    <a :href="hrefA+'/dordinary?a=1&id='+vv.id" class="textl  w033 ovh bg">
                    	<div class="cont2 pdlr10 bbx marb15 ovh fsw5 fs15  h20 lh20 tbm " v-text="vv.name"></div>
                    </a>
                </template>
               
            </div>
            <div class="h10"></div>
        </div>
    </div>`,
    data: function () { return{
        info:[],
        types1:[],
        types2:[],
        a_href:'',
        hrefA:hrefA

    } },
    created() {
        let v=this
        v.getList()
    },
    methods: {
        getList(){
                let v= this
                let uri = '/api/article/column'
                // let column_id = 1
                let column_id = v.$route.query.column_id || 1
                ajax({url:uri,method:'get',data:{column_id:column_id}}).then((r)=>{
                    if(r.code == 200){
                        // console.log('r.data',r.data);·
                        let ob = {
                            info:{column_id:'1',type:1,img:'/static/img/cube_174.png'},
                            types:[
                                {name:'热门急救',list:[{id:'1',avatar:'/static/img/cube_174.png',name:'心脏复苏'},{id:'1',avatar:'/static/img/cube_174.png',name:'心脏复苏'},{id:'1',avatar:'/static/img/cube_174.png',name:'心脏复苏'}]},
                                {name:'急救基础',list:[{id:'1',name:'止血包扎止血包扎'},{id:'1',name:'止血包扎'},{id:'1',name:'止血包扎'},{id:'1',name:'止血包扎'}]},
                                {name:'异物卡刺',list:[{id:'1',name:'项目标题项目标题'},{id:'1',name:'项目标题'},{id:'1',name:'项目标题'},{id:'1',name:'项目标题'}]}
                            ]
                        }
                        if(v.$route.query.enable == 1)r.data = ob

                        v.info=r.data.info
                        v.a_href = r.data.info.type?`${hrefA}/dordinary?a=1&column_id=${r.data.info.column_id}`:""

                        v.types1=r.data.types[0]
                        r.data.types.splice(0,1)
                        v.types2=r.data.types
                    }
                }).catch((e)=>{
                    console.log('catch',e);
                })
            }
        },
}
export default firstaid